<?php

namespace common\entities\myhtsq;

use common\entities\ContractEntity;
use Yii;

/**
 * This is the model class for table "myscrm_document".
 *
 * @property string $document_id
 * @property string $document_name
 * @property string $document_ext_name
 * @property string $document_path
 * @property string $business_id
 * @property string $created_on
 * @property string $created_by
 * @property string $modified_on
 * @property string $modified_by
 */
class DocumentEntity extends ContractEntity
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'myscrm_document';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['document_id'], 'required'],
            [['created_on', 'modified_on','received_on'], 'safe'],
            [['document_id', 'business_id', 'created_by', 'modified_by','creator_id','recipient_id','received_by','opportunities_id'], 'string', 'max' => 36],
            [['document_type'], 'integer'],
            [['document_name'], 'string', 'max' => 100],
            [['document_ext_name'], 'string', 'max' => 10],
            [['document_path'], 'string', 'max' => 500],
            [['out_file_id'], 'string', 'max' => 64],
            [['is_sign'], 'string', 'max' => 1],
            [['contract_code'], 'string', 'max' => 255],
            [['document_old_name'], 'string', 'max' => 255],
            [['document_new_name'], 'string', 'max' => 255],
            [['bop_file_type'], 'string', 'max' => 128],
            [['document_size'], 'integer'],
            [['document_group'], 'integer'],
            [['created_on', 'received_on'], 'default', 'value' => date('Y-m-d H:i:s')],
            ['document_size','default','value'=>0],
            ['opportunities_id','default','value'=>''],
            ['is_sign','default','value'=>'0']
            
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'document_id' => '文档ID',
            'document_name' => '文档名称',
            'document_ext_name' => '文档类型',
            'document_path' => '存放路径',
            'business_id' => '业务ID',
            'created_on' => '创建时间',
            'created_by' => '创建人',
            'modified_on' => '修改时间',
            'modified_by' => '修改人',
            'document_type' => '文档类型',
            'out_file_id'   => '亿方云ID',
            'creator_id'   => '创建人ID',
            'recipient_id'   => '接受人ID',
            'received_by'   => '接收人名称',
            'received_on'   => '接收日期',
            'is_sign'   => '是否签字',
            'contract_code'   => '合同Code',
            'document_old_name'   => '文档旧名称',
            'document_new_name'   => '文档新名称',
            'bop_file_type'   => '附件类型[客户接收单，终端接收单]',
            'opportunities_id'   => '出库单ID',
            'document_size'   => '文档大小',
            'document_group'   => '文件组类型:0-ERP  1-云客  2-云链  3-云空间',
        ];
    }
}
